//--------------------------------------------------------------------------------
// This file is a portion of the D2D1Renderer.  It is distributed
// under the MIT License, available in the root of this distribution and 
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.php
//
// Copyright (c) Mirco Timmermann
//
//--------------------------------------------------------------------------------
#pragma once

#ifndef _PROGRESS_BAR_H
#define _PROGRESS_BAR_H

#include "..\DisplayObject.h"
#include "..\..\..\Rendering\canvas\Color.h"

class ProgressBar : public D2::DisplayObject {

public:
	ProgressBar(int x, int y, int width, int height);
	~ProgressBar(void);

/////////////////////////////DATA////////////////////////////
private:
	int _minValue; //0
	int _maxValue; //100

	float _value_norm; //[0..1]

public:
	void SetValue(int value);
	int GetValue();

	void SetValue_norm(float value);
	float GetValue_norm();

private:
	int interpolate(float value_norm);

////////////////////////////VISUALISATION//////////////////////////

public:
	virtual bool Draw(Direct2DContext* ctx, D2D1::Matrix3x2F* mtx = 0);
	void SetColor(float r, float g, float b);

private:
	Color _color;

};

#endif